﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="editnumbertype.aspx.cs" Inherits="editNumberTypes" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript"> 
        function KeyDownHandler() { 
            // process only the Enter key 
            if (event.keyCode == 13) { 
                __doPostBack('<%=gvEditNumberType.FooterRow.FindControl("btInsert").UniqueID%>', ''); 
            } 
        } 
    </script> 
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <prt:ShowFooterGridView ID="gvEditNumberType" runat="server" ShowFooterWhenEmpty="True" 
            AutoGenerateColumns="False" DataKeyNames="NumberTypeID" DataSourceID="dsNumberType" 
            ShowHeaderWhenEmpty="True" ShowFooter="true" >
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton0" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:LinkButton ID="btInsert" runat="server" Text="Insert" OnClick="gvNumberType_Insert" />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Description" SortExpression="Description">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Description") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("Description") %>' />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="tbDescription_Insert" runat="server" />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Phone" SortExpression="Phone">
                    <EditItemTemplate>
                        <asp:CheckBox ID="CheckBox0" runat="server" Checked='<%# Bind("Phone") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("Phone") %>' Enabled="false" />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:CheckBox ID="cbPhone_Insert" runat="server" onKeyDown='KeyDownHandler();' />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="SMSCapable" SortExpression="SMSCapable">
                    <EditItemTemplate>
                        <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("SMSCapable") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox3" runat="server" Checked='<%# Eval("SMSCapable") %>' Enabled="false" />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:CheckBox ID="cbSMS_Insert" runat="server" onKeyDown='KeyDownHandler();' />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="AlphaCapable" SortExpression="AlphaCapable">
                    <EditItemTemplate>
                        <asp:CheckBox ID="CheckBox4" runat="server" Checked='<%# Bind("AlphaCapable") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox5" runat="server" Checked='<%# Eval("AlphaCapable") %>' Enabled="false" />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:CheckBox ID="cbAlpha_Insert" runat="server" onKeyDown='KeyDownHandler();' />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Fax" SortExpression="Fax">
                    <EditItemTemplate>
                        <asp:CheckBox ID="CheckBox6" runat="server" Checked='<%# Bind("Fax") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox7" runat="server" Checked='<%# Eval("Fax") %>' Enabled="false" />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:CheckBox ID="cbFax_Insert" runat="server" onKeyDown='KeyDownHandler();' />
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
        </prt:ShowFooterGridView>
        <asp:ObjectDataSource ID="dsNumberType" runat="server" DeleteMethod="Delete" 
            InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetData" 
            TypeName="AnseringServiceTableAdapters.NumberTypeTableAdapter" 
            UpdateMethod="Update">
            <DeleteParameters>
                <asp:Parameter Name="Original_NumberTypeID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Phone" Type="Boolean" />
                <asp:Parameter Name="SMSCapable" Type="Boolean" />
                <asp:Parameter Name="AlphaCapable" Type="Boolean" />
                <asp:Parameter Name="Fax" Type="Boolean" />
                <asp:Parameter Name="Original_NumberTypeID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Phone" Type="Boolean" />
                <asp:Parameter Name="SMSCapable" Type="Boolean" />
                <asp:Parameter Name="AlphaCapable" Type="Boolean" />
                <asp:Parameter Name="Fax" Type="Boolean" />
            </InsertParameters>
        </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
